<template>
  <view class="query flex-direction-column">
    <view class="name">{{ props.title }}</view>
    <view class="search flex-space-between">
      <input :placeholder="props.placeholder" v-model="key_word" placeholder-style="color:#BBBBBB" />
      <view class="btn flex" @click="findClick">
        <image src="/pagesA/static/image/20.png"></image>
        <text>查询</text>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const emit = defineEmits(['change'])

const props = defineProps({
  title: {
    type: String,
    default() {
      return ''
    }
  },
  placeholder: {
    type: String,
    default() {
      return ''
    }
  }
})

let key_word = ref('')

const findClick = () => {
  emit('change', key_word)
}
</script>

<style lang="scss" scoped>
.query {
  width: 100%;
  padding: 34rpx;
  .name {
    font-size: 32rpx;
    font-weight: bold;
    line-height: 50rpx;
  }
  .search {
    margin-top: 40rpx;
    input {
      width: 400rpx;
      outline: none;
      font-size: 28rpx;
      border-radius: 6rpx;
      padding: 16rpx 32rpx;
      border: 1px solid #dddddd;
    }
    .btn {
      border-radius: 6rpx;
      padding: 19rpx 34rpx;
      background-color: #e6425e;
      image {
        width: 32rpx;
        height: 32rpx;
        margin-right: 22rpx;
      }
      text {
        color: #fff;
        font-size: 32rpx;
      }
    }
  }
}
</style>
